﻿<UserControl x:Class="SheepClock.CustomUIComponents.AlarmSettingsItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="200" d:DesignWidth="400">

    <UserControl.Resources>
        <Storyboard x:Name="PushStoryBoard_saveButton">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="saveButtonBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryBoard_deleteButton">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="deleteButtonBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryBoard_hourMinus">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hourMinusBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryBoard_hourPlus">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="hourPlusBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryBoard_minuteMinus">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="minuteMinusBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryBoard_minutePlus">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="minutePlusBack">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0.8">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot"
          Background="{StaticResource PhoneChromeBrush}">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="64" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="90" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <TextBox x:Name="NameTextBox" Height="72"
                 HorizontalAlignment="Left" 
                 Margin="0,12,0,0"
                 Text="" 
                 VerticalAlignment="Top" 
                 Width="336" />


        <Ellipse x:Name="saveButtonBack"
                 Grid.Column="1"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
        <Rectangle x:Name="saveButton"
                   Grid.Column="1"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Width="48"
                   Height="48"
                   Fill="{StaticResource PhoneContrastBackgroundBrush}"
                   MouseLeftButtonDown="saveButton_MouseLeftButtonDown" >
            <Rectangle.OpacityMask>
                <ImageBrush ImageSource="../Images/save.png"/>
            </Rectangle.OpacityMask>
        </Rectangle>


        <Ellipse x:Name="deleteButtonBack"
                 Grid.Column="1"
                 Grid.Row="1"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
        <Rectangle x:Name="deleteButton"
                   Grid.Column="1"
                   Grid.Row="1"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Width="48"
                   Height="48"
                   Fill="{StaticResource PhoneContrastBackgroundBrush}"
                   MouseLeftButtonDown="deleteButton_MouseLeftButtonDown" >
            <Rectangle.OpacityMask>
                <ImageBrush ImageSource="../Images/delete.png"/>
            </Rectangle.OpacityMask>
        </Rectangle>
        
        

        <Grid 
            Grid.Row="1"
            Margin="0"
            >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="140" />
                <ColumnDefinition Width="64" />
                <ColumnDefinition Width="64" />
                <ColumnDefinition Width="64" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="52" />
                <RowDefinition Height="52" />
            </Grid.RowDefinitions>

            <Ellipse x:Name="hourMinusBack"
                 Grid.Column="1" 
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
            <Rectangle x:Name="hourMinus"
                       Grid.Column="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}"
                       MouseLeftButtonDown="hourMinus_MouseLeftButtonDown" >
            <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="../Images/minus.png"/>
            </Rectangle.OpacityMask>
            </Rectangle>


            <Ellipse x:Name="hourPlusBack"
                 Grid.Column="4" 
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
            <Rectangle x:Name="hourPlus"
                       Grid.Column="4"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}"
                       MouseLeftButtonDown="hourPlus_MouseLeftButtonDown">
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="../Images/plus.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>


            <Ellipse x:Name="minuteMinusBack"
                 Grid.Column="1"
                 Grid.Row="1"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
            <Rectangle x:Name="minuteMinus"
                       Grid.Column="1"
                       Grid.Row="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}"
                       MouseLeftButtonDown="minuteMinus_MouseLeftButtonDown" >
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="../Images/minus.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>


            <Ellipse x:Name="minutePlusBack"
                 Grid.Column="4"
                 Grid.Row="1"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Width="48"
                 Height="48" 
                 Stroke="Transparent"
                 StrokeThickness="1" 
                 Fill="{StaticResource PhoneAccentBrush}"
                 Opacity="0"
                 />
            <Rectangle x:Name="minutePlus"
                       Grid.Column="4"
                       Grid.Row="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Width="48"
                       Height="48"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}"
                       MouseLeftButtonDown="minutePlus_MouseLeftButtonDown">
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="../Images/plus.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>

            <TextBox x:Name="hourTextBox"
                     Grid.Column="2" 
                     Height="70" 
                     HorizontalAlignment="Center" 
                     Margin="0"  
                     Text=""
                     TextAlignment="Center"
                     VerticalAlignment="Center"
                     Width="72" 
                     InputScope="Number" 
                     TextChanged="TextBox_TextChanged"
                     ManipulationStarted="hourTextBox_ManipulationStarted"/>
            <TextBox x:Name="minuteTextBox"
                     Grid.Row="2" 
                     Grid.Column="2" 
                     Height="70" 
                     HorizontalAlignment="Center" 
                     Margin="0"  
                     Text=""
                     TextAlignment="Center"
                     VerticalAlignment="Center"
                     Width="72" 
                     InputScope="Number" 
                     TextChanged="TextBox_TextChanged"
                     ManipulationStarted="hourTextBox_ManipulationStarted"/>

            <TextBlock 
                Grid.Column="0"
                Grid.Row="0"
                Height="30" 
                HorizontalAlignment="Left"
                Margin="12,0,0,0"
                Text="set hour:"
                VerticalAlignment="Center" />
            <TextBlock 
                Grid.Column="0"
                Grid.Row="1"
                Height="30" 
                HorizontalAlignment="Left"
                Margin="12,0,0,0"
                Text="set minute:"
                VerticalAlignment="Center" />
            
        </Grid>
    </Grid>
</UserControl>
